import Vue from 'vue'
import Router from 'vue-router'
Vue.use(Router)
// 路由懒加载
const home = (resolve) => {
    import('@/components/home').then((module) => {
        resolve(module)
    })
}
const login = (resolve) => {
    import('@/components/login').then((module) => {
        resolve(module)
    })
}
const discover = (resolve) => {
    import('@/components/discover').then((module) => {
        resolve(module)
    })
}
const mine = (resolve) => {
    import('@/components/mine').then((module) => {
        resolve(module)
    })
}
const router = new Router({
    routes: [
        // 根路径
        {
            path: '/',
            redirect: '/home',
            component: home,
            meta: { title: '首页', isShowHead: false, isShowFoot: true }
        },
        // 首页
        {
            path: '/home',
            component: home,
            meta: { title: '首页', isShowHead: false, isShowFoot: true }
        },
        {
            path: '/login/',
            component: login,
            meta: { title: '登录注册', isShowHead: true, isShowFoot: false }
        },
        {
            path: '/discover/',
            component: discover,
            meta: { title: '发现', isShowHead: true, isShowFoot: false }
        },
        {
            path: '/mine/',
            component: mine,
            meta: { title: '我的', isShowHead: true, isShowFoot: false }
        },
    ]
})
export default router
